package org.gwt.pluginframework.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.gwt.pluginframework.common.extension.IExtension;
import org.gwt.pluginframework.common.extension.IExtensionRegister;

public abstract class ComplexPlugin extends Plugin implements IExtensionRegister {

	private static final long serialVersionUID = 8893094767161208018L;

	protected Map<String, List<IExtension>> extensions = new HashMap<String, List<IExtension>>();
	
	public void registerExtension(String extensionPointName, IExtension extension) {
		List<IExtension> list = extensions.get(extensionPointName);
		if(list == null) {
			list = new ArrayList<IExtension>();
			extensions.put(extensionPointName, list);
		}
		list.add(extension);
	}
}
